import SegmentedControlTab from 'react-native-segmented-control-tab'
import React, { Component } from 'react';
import {Platform, StyleSheet, Text, View, Button} from 'react-native';

export default class TopSwitchBar extends Component {
	constructor(props) {
		super(props)
		this.state = {
			selectedIndex: 0
		}
	}
	handleIndexChange = (index) => {
		this.setState({
			selectedIndex: index
		})
		
	}
	render() {
		return (<View style={{ width: '100%', justifyContent: 'center', alignItems: 'center' }}>
			<View style={{width: '50%'}}>
				<SegmentedControlTab
					values={['买币', '卖币']}
					selectedIndex={this.state.selectedIndex}
					tabStyle={{backgroundColor: '#fff', borderColor: '#ff7706' }}
					activeTabStyle={{backgroundColor: '#ff7706'}}
					tabTextStyle={{color: '#ff7706', fontSize: 14}}
					activeTabTextStyle={{color: '#fff'}}
					onTabPress={this.handleIndexChange}
				/>
			</View>
		</View>)
	}
}
